<?php
header("Content-type: text/html; charset=utf-8");



function url_encode($str) {  
    if(is_array($str)) {  
        foreach($str as $key=>$value) {  
            $str[urlencode($key)] = url_encode($value);  
        }  
    } else {  
        $str = urlencode($str);  
    }  
      
    return $str;  
}  

function encode_json($str) {  
    return urldecode(json_encode(url_encode($str)));      
}  


       
      
       



?>